<?php
	include('../../../../common/php/authority.php');
	
	$sql = "SELECT id, name, userName, (SELECT name FROM userType WHERE id = userTypeId) AS uType FROM `user`";
	$res = mysql_query($sql)or die(mysql_error());
	$num_rows = mysql_num_rows($res);
		
	for ($i = 0; $i < $num_rows; $i++)
	{
		$row = mysql_fetch_array($res);
		$userArr['id'] = $row['id'];
		$userArr['name'] = $row['name'];
		$userArr['userName'] = $row['userName'];
		$userArr['userType'] = $row['uType'];
		
		$userArrAll[] = $userArr;
	}
	
	$arrJson['count'] = $num_rows;
	$arrJson['success']='true';
	$arrJson['users']=$userArrAll;
	echo json_encode($arrJson);
?>
